	.globl memcpy
memcpy:
	stmdb	sp!, {r4, lr}
	cmp	r2, #0
	beq	2f
	add	r4, r0, r2	@ set r4 to the address of the last byte copied
1:      ldrb	r3, [r1], #1
	strb	r3, [r0], #1
	cmp	r0,  r4
	bne	1b
	sub	r0, r4, r2	@ return original destination address
2:      ldmia	sp!, {r4, pc}
